import CryptoJS from "crypto-js";

export const encrypt = (word: string) => {
  const srcs = CryptoJS.enc.Utf8.parse(word);
  // WIAM1TQPDY03PSG0  H8SG821GQZFZE065(平台)
  const key = CryptoJS.enc.Utf8.parse("WIAM1TQPDY03PSG0".padEnd(16, 0));
  const encrypted = CryptoJS.AES.encrypt(srcs, key, {
    iv: key,
    mode: CryptoJS.mode.CBC,
    padding: CryptoJS.pad.Pkcs7,
  });
  return encrypted.toString();
};
